/**
 * @author zowie 
 * @param {number[]} temperatures
 * @return {number[]} c
 */

// 学习要一步一步来 要先完成后优化，不然容易跌跟头
var dailyTemperatures = function (temperatures) {
  let c = []
  for (let i = 0; i < temperatures.length - 1; i++) { //除了最后一个元素每个元素都要遍历到
    console.log(i, 'iiiiii')
    for (let j = 1 + i; j <= temperatures.length; j++) {
      console.log(j, 'jjjjjjj')
      if (temperatures[i] >= temperatures[j]) {
        continue
      }
      else {
        c.push((j == temperatures.length) ? 0 : (j - i))
        console.log(c)
        break
      }
    }
  }
  c.push(0)
  return c
};